﻿namespace ExtraFoundation.Components
{
    public class Tools
    {
        
        private const int BASE = 1000000;
        
        public static int StringToHash(string target)
        {
            char[] tChar = target.ToCharArray();
            int targetCode = 0;
            foreach (var t in tChar)
            {
                targetCode = (targetCode * 31 + t) % BASE;
            }
            return targetCode;
        }
        
    }
}